package com.combat.text.user.controller;

import com.combat.text.user.service.PowerService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author： Lizehui
 * @date: 2020/12/18 16:44
 * @Description: 获取用户的postid 来进行权限的查询
 */
@RestController
@RequestMapping("/api")
public class LoginController {
    @Autowired
    PowerService powerService;

    @ApiOperation("一级权限")
    @GetMapping("/power/{post}")
    public List<Map<String,Object>> show(@PathVariable int post){
        return powerService.show(post);
    }

    @ApiOperation("二级权限")
    @GetMapping("/power1/{rno}")

    public List<Map<String,Object>> show1(@PathVariable int rno){
        System.out.println(rno);
        return powerService.show1(rno);
    }


}
